public class P4_Trycatch2{
	//自定义异常类 来处理异常
	//并试分析多态的存在
	public static void main(String args[]){
		
		int arr[] = { 1,2,3,4};
		try{
			System.out.println(arr[m()]);
			//throw new MyException();
		}
		catch (Exception e) {  
			//System.out.println(e.toString());
		}
		
	}

	static int m(){
		return 3;
	}
}

class MyException extends ArrayIndexOutOfBoundsException{
	public String toString(){
		String s = "This is my Array Index Out Of Bounds Exception";
		return s;
	}
}